package cn.xiaopengstack.domain.activity.service.discount.impl;

import cn.xiaopengstack.domain.activity.model.dto.DiscountCalculateDTO;
import cn.xiaopengstack.domain.activity.service.discount.AbstractDiscountCalculateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @author jiangyangang
 */
@Service("N")
@Slf4j
public class NCalculateService extends AbstractDiscountCalculateService {

    @Override
    protected BigDecimal doCalculate(DiscountCalculateDTO calculateDTO) {
        log.info("N元购买优惠折扣计算:{}", calculateDTO.getGroupBuyDiscount().getDiscountType());
        BigDecimal discountPrice = new BigDecimal(calculateDTO.getGroupBuyDiscount().getMarketExpr());
        return discountPrice;
    }
}
